
import VueRouter from "vue-router";
import infoRoutes from "./information";
import goodsRoutes from "./goodComponents";
import storeRoutes from "./storehouse";
import cashRoutes from "./cash"
import sellRoutes from "./sell"
import Login from "@/components/public_com/Login.vue";
import Index from "@/components/Index.vue";
import purchaseRoutes from "./purchase";
import workProcessRouter from "./workProcess"
import ProviderChoose from "@/components/public_com/ProviderChoose.vue";
import Chart from "@/components/Chart.vue";
import Register from "@/components/public_com/Register.vue";
import processRoute from "./process"

const router = new VueRouter({

  routes: [
    {
      path: '/login',
      name: 'login',
      component: Login,

    },
    {
      path: '/register',
      name: 'register',
      component: Register
    },
    // {
    //   path: '/index',
    //   name: 'index',
    //   component: Index
    // },
    {
      path: '/',
      name: 'index',
      component: Index,
      meta: { 'title': '首页' },
      children: [
        ,
        {
          path: 'chart',
          name: 'chart',
          component: Chart
        },
        ...workProcessRouter,
        ...purchaseRoutes,
        ...goodsRoutes,
        ...infoRoutes,
        ...storeRoutes,
        ...cashRoutes,
        ...sellRoutes,
        ...processRoute,
      ]
    },
    {
      path: '/providerChoose',
      name: 'providerChoose',
      component: ProviderChoose
    }
  ]
}
)

export default router